package com.dingding.common.core.base.daox;

/**
 * 
 * @ClassName: IBaseDao
 * @Description:所有dao接口都继承自当前接口
 * @author CHEHUANBO
 * @since V2.4.0
 * 
 */
public interface IBaseDaoX {
	
	/**
	 * 
	 * @Title: getById 
	 * @Description: 根据ID获取实体对象 
	 * @param id 主键ID 
	 * @return T 
	 * @author CHEHUANBO 
	 * 
	 */
	public <T> T getById(Integer id, Class<T> clazz);

	/**
	 * 
	 * @Title: getById 
	 * @Description: 根据ID获取实体对象 
	 * @param id 主键ID 
	 * @return T 
	 * @author CHEHUANBO 
	 * 
	 */
	public <T> T getById(String id, Class<T> clazz);

	/**
	 * 
	 * @Title: save 
	 * @Description: 保存实体对象
	 * @param entity 待保存的实体
	 * @author CHEHUANBO
	 * 
	 */
	public <T> boolean save(T entity);

	/**
	 * 
	 * @Title: save 
	 * @Description: 更新实体对象
	 * @param entity 待更新的实体
	 * @author CHEHUANBO
	 * 
	 */
	public <T> boolean update(T entity);

	/**
	 * 
	 * @Title: delete 
	 * @Description: 删除实体对象
	 * @param entity 待删除的实体
	 * @author CHEHUANBO
	 * 
	 */
	public <T> boolean delete(T entity);
	
	/**
	 * @Description:保存或更新
	 * @author fengshuonan
	 * @since 2.4
	 */
	public <T> boolean saveOrUpdate(T entity);
	
}
